import makerjs from "makerjs"
import { getPointer } from "./getPointer"

const Line = {
    wheel: function (e, _this) {
        var scale = _this.viewScale + e.deltaY / 1000;
        _this.viewScale = Math.max(scale, 0.01)
    },
    pointermove: function (e, _this) {
        if (e.pressure) {
            _this.$set(_this.model.paths, "line" + _this.layer,
                new makerjs.paths.Line(_this.last_pointer_down,
                    getPointer(e, _this)
                )
            );
        }
    },
    pointerdown: function (e, _this) {
        _this.last_pointer_down = getPointer(e, _this);
    },
    pointerup: function (e, _this) {
        _this.layer++;
    },
}
export default Line;
